<extend name="Public/base" />
<block name='style'>


    <link href="__STATIC__/iCheck/skins/flat/green.css" rel="stylesheet">
    <link href="__STATIC__/select2/dist/css/select2.min.css" rel="stylesheet">
    <!-- Switchery -->
    <link href="__STATIC__/switchery/dist/switchery.min.css" rel="stylesheet">
    <link href="__STATIC__/starrr/dist/starrr.css" rel="stylesheet">
</block>
<block name="body">
    <!-- page content -->
    <div class="right_col" role="main">
        <div class="">
            <div class="clearfix"></div>
            <div class="row">


                <div class="col-md-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_title">
                            
                            <h2><i class="fa fa-bars"></i>{$meta_title} <small>different form elements</small></h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a href="#">Settings 1</a>
                                        </li>
                                        <li><a href="#">Settings 2</a>
                                        </li>
                                    </ul>
                                </li>
                                <li><a class="close-link"><i class="fa fa-close"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content">
                            <br />
                            <form action="{:U('update')}" class="form1 form-horizontal form-label-left" method="post">
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">字段名*</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <input type="text"  name="name"  value="{$info.name}" class="form-control" placeholder="请输入字段名 英文字母开头，长度不超过30" >
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">字段标题*</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <input type="text" name="title" value="{$info.title}" class="form-control "   placeholder="请输入字段标题，用于表单显示">
                                       

                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">字段类型*</label>
                                    <div class="col-md-2 col-sm-2 col-xs-12">
                                          <select name="type" class="form-control" id="data-type">
								<option value="">----请选择----</option>
								<volist name=":get_attribute_type()" id="type">
								<option value="{$key}" rule="{$type[1]}" <eq name='key' value='$info["type"]'>selected="selected"</eq> >{$type[0]}</option>
								</volist>
                                          </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">字段定义 <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <input type="text" name="field"  value="{$info.field}" class="form-control" id="data-field" placeholder="字段属性的sql表示">

                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">参数</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <textarea  name="extra"   class="form-control" id="inputSuccess3" placeholder="字段类型为布尔、单选、多选、枚举和级联选择时的定义数据，其它字段类型为空">{$info.extra}</textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">默认值</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <input type="text" name="value"  value="{$info.value}" id="autocomplete-custom-append" class="form-control col-md-10"  placeholder="字段的默认值"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">字段备注</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        
                                                 <input type="text" name="remark"  value="{$info.remark}" id="autocomplete-custom-append" class="form-control col-md-10"  placeholder="用于表单中的提示"/>
                                          
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">是否显示</label>
                                    <div class="col-md-2 col-sm-2 col-xs-12">
                                        <select name="is_show" class="form-control">
                                            <option value="1" <eq name='info.is_show' value='1'>selected="selected"</eq>>始终显示</option>
								<option value="2" <eq name='info.is_show' value='2'>selected="selected"</eq>>新增显示</option>
								<option value="3" <eq name='info.is_show' value='3'>selected="selected"</eq>>编辑显示</option>
                                                                <option value="4" <eq name='info.is_show' value='4'>selected="selected"</eq>>隐藏值</option>
								<option value="0" <eq name='info.is_show' value='0'>selected="selected"</eq>>不显示</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">是否必填</label>
                                    <div class="col-md-2 col-sm-2 col-xs-12">
                                          <select name="is_must" class="form-control">
                                            	<option value="0" <eq name='info.is_must' value='0'>selected="selected"</eq>>否</option>
						<option value="1" <eq name='info.is_must' value='1'>selected="selected"</eq>>是</option>
                                        </select>
                                    </div>
                                </div>
                                
                                
                                
                    <div class="x_title">
                    <h2><i class="fa fa-align-left"></i> 高级 </h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link1"><i class="fa fa-chevron-up"></i></a>
                      </li>
                     
                     
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                                
                                <div class="x_content1" style="display: none;">
                                    <br>
                      <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">验证方式</label>
                                    <div class="col-md-3 col-sm-3 col-xs-12">
                                    <select name="validate_type" class="form-control ">
								<option value="regex">正则验证</option>
								<option value="function">函数验证</option>
								<option value="unique">唯一验证</option>
								<option value="length">长度验证</option>
                                <option value="in">验证在范围内</option>
                                <option value="notin">验证不在范围内</option>
                                <option value="between">区间验证</option>
                                <option value="notbetween">不在区间验证</option>
							</select>  
                                    
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">验证规则</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <input type="text" name="validate_rule" value="{$info.validate_rule}" class="form-control "   placeholder="根据验证方式定义相关验证规则">
                                       

                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">出错提示</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <input type="text" name="error_info" value="{$info.error_info}" class="form-control "   placeholder="">
                                       

                                    </div>
                                </div>
                                    
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">验证时间</label>
                                    <div class="col-md-2 col-sm-2 col-xs-12">
                                      <select name="validate_time" class="form-control ">
                                                               <option value="3">始 终</option>
								<option value="1">新 增</option>
								<option value="2">编 辑</option>
					</select>

                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">自动完成方式</label>
                                    <div class="col-md-2 col-sm-2 col-xs-12">
                                       <select name="auto_type" class="form-control ">
								<option value="function">函数</option>
								<option value="field">字段</option>
								<option value="string">字符串</option>
					</select>
                                       

                                    </div>
                                </div> 
                                    
                                 <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">自动完成规则</label>
                                    <div class="col-md-9 col-sm-9 col-xs-12">
                                        <input type="text" name="auto_rule" value="{$info.auto_rule}" class="form-control "   placeholder="根据完成方式订阅相关规则">
                                       

                                    </div>
                                </div> 
                                    
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">自动完成时间</label>
                                    <div class="col-md-2 col-sm-2 col-xs-12">
                                        <select name="auto_time" class="form-control ">
								<option value="3">始 终</option>
								<option value="1">新 增</option>
								<option value="2">编 辑</option>
							</select>
                                       

                                    </div>
                                </div> 
                             


                  </div>

                               <input type="hidden" name="id" value="{$info['id']}"/>
						<input type="hidden" name="model_id" value="{$info['model_id']}"/>

                                <div class="ln_solid"></div>
                                <div class="form-group">
                                    <div class="col-md-9 col-sm-9 col-xs-12 col-md-offset-3">
                                        <a href="{:U('index')}" class="btn btn-primary">关闭</a>
                                        <button type="submit" class="btn btn-success">保存</button>
                                    </div>
                                </div>

                            </form>
                        </div>
                    </div>
                </div>






            </div>
        </div>
    </div>
</block>    
<block name='script'>
    <!-- iCheck -->
    <script src="__STATIC__/iCheck/icheck.min.js"></script>
    <!-- Select2 -->
    <script src="__STATIC__/select2/dist/js/select2.full.min.js"></script>
    <!-- jQuery Tags Input -->
    <script src="__STATIC__/jquery.tagsinput/src/jquery.tagsinput.js"></script>
    <!-- Switchery -->
    <script src="__STATIC__/switchery/dist/switchery.min.js"></script>
    <!-- jQuery autocomplete -->
    <script src="__STATIC__/devbridge-autocomplete/dist/jquery.autocomplete.min.js"></script>
    <!-- Autosize -->     
    <script src="__STATIC__/autosize/dist/autosize.min.js"></script>
    <!-- starrr -->
    <script src="__STATIC__/starrr/dist/starrr.js"></script>


    <!-- Select2 -->
    <script>


        var validator = {
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                title: {
                    validators: {
                        notEmpty: {
                            message: '菜单名字不能为空'
                        }
                    }
                },
                class_icon: {
                    validators: {
                        notEmpty: {
                            message: '小图标不能为空'
                        }
                    }
                },
                sort: {
                    validators: {
                        regexp: {
                            regexp: /^[0-9\.]+$/,
                            message: '只能填写数字'
                        }
                    }
                },
                url: {
                    validators: {
                        notEmpty: {
                            message: '联接不能为空'
                        }
                    }
                }
            }
        };
        $(document).ready(function () {
            $(".select2_single").select2({
                placeholder: "Select a state",
                allowClear: true
            });
            $(".select2_group").select2({});
            $(".select2_multiple").select2({
                maximumSelectionLength: 4,
                placeholder: "With Max Selection limit 4",
                allowClear: true
            });
        });</script>
    <!-- /Select2 -->

    <!-- jQuery Tags Input -->

    <!-- /jQuery Tags Input -->


    <!-- Autosize -->
    <script>
        $(document).ready(function () {
            
             $('.collapse-link1').on('click', function() {
        var $BOX_PANEL = $(this).closest('.x_panel'),
            $ICON = $(this).find('i'),
            $BOX_CONTENT = $BOX_PANEL.find('.x_content1');
        
        // fix for some div with hardcoded fix class
        if ($BOX_PANEL.attr('style')) {
            $BOX_CONTENT.slideToggle(200, function(){
                $BOX_PANEL.removeAttr('style');
            });
        } else {
            $BOX_CONTENT.slideToggle(200); 
            $BOX_PANEL.css('height', 'auto');  
        }

        $ICON.toggleClass('fa-chevron-up fa-chevron-down');
    });
	$('#data-type').change(function(){
		$('#data-field').val($(this).find('option:selected').attr('rule'));
	});

            autosize($('.resizable_textarea'));
        });</script>
    <!-- /Autosize -->

    <!-- jQuery autocomplete -->
   
</block>    